import request from '@/utils/request'

export function listRole(params) {
  return request({
    url: '/admin/role/list',
    method: 'get',
    params
  })
}

export function getRole(role_id) {
  return request({
    url: `/admin/role/info/${role_id}`,
    method: 'get'
  })
}

export function delRole(role_id) {
  return request({
    url: `/admin/role/delete/${role_id}`,
    method: 'post'
  })
}

export function addRole(data) {
  return request({
    url: '/admin/role/create',
    method: 'post',
    data
  })
}

export function updateRole(role_id, data) {
  return request({
    url: `/admin/role/update/${role_id}`,
    method: 'post',
    data
  })
}
